using System;

namespace Mbs.Modularity
{
    [Serializable]
    public class ModuleListnerManager : ListnerManager<IModuleListner,ModuleListnerType>,IModuleListnerManager,IModuleListner
    {
        public static readonly IModuleListnerManager Instance = new ModuleListnerManager();
        internal static IModuleListner Listner
        {
            get { return Instance as IModuleListner ; }
        }

        public ModuleListnerType Type { get; private set; }

        public void OnInstalled(ModuleEventArgs e)
        {
            Foreach((item) => item.OnInstalled(e));
        }

        public void OnStarted(ModuleEventArgs e)
        {
            Foreach((item) => item.OnStarted(e));
        }

        public void OnStopped(ModuleEventArgs e)
        {
            Foreach((item) => item.OnStopped(e));
        }

        public void OnUninstalled(ModuleEventArgs e)
        {
            Foreach((item) => item.OnUninstalled(e));
        }

        public void OnStarting(ModuleEventArgs e)
        {
            Foreach((item) => item.OnStarting(e));
        }

        public void OnStopping(ModuleEventArgs e)
        {
            Foreach((item) => item.OnStopping(e));
        }

        public void OnExcption(ModuleEventArgs e)
        {
            Foreach((item) => item.OnExcption(e));
        }
    }
}
